<!DOCTYPE html>
<html>

<head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Node OAuth2 Demo</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>


        <h1>登陆页面</h1>
        <a id="login">Login with GitHub</a>

<script>
       // https://gitee.com/oauth/authorize?client_id=b6777752e4ffb7bd7e59618d709cafadd08ca89f59acaffafe66bef5ccbaf341&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Foauth%2Fredirect&response_type=code

  // fill in your cliend_id
  const client_id = 'b6777752e4ffb7bd7e59618d709cafadd08ca89f59acaffafe66bef5ccbaf341';
  // github提供的一个授权地址
//   const authorize_uri = 'https://github.com/login/oauth/authorize';
  const authorize_uri = 'https://gitee.com/oauth/authorize'
  // 跟你的后端匹配的一个路由
  const redirect_uri = 'http://localhost:8080/oauth/redirect';

  const link = document.getElementById('login');

  // 点击登陆按钮，跳转到了github, 同时携带了client_id，还携带了一个，一会要跳回来的地址
  link.href = `${authorize_uri}?client_id=${client_id}&redirect_uri=${redirect_uri}&response_type=code`;
</script>

</body>

</html>
